package zut.edu.cn.concertticketmanagementsystem.utils;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: heroma
 * Date: 6/22/19
 * Time: 4:48 PM
 * Description: No Description
 */
public class KeyGenarate {
    /**
     * 生成唯一的主键
     * 格式：时间+随机数
     */
    public static synchronized String genUniqueKey(){
        Random random=new Random();
        Integer numbet=random.nextInt(900000)+100000;
        return System.currentTimeMillis()+String.valueOf(numbet);
    }
}
